package org.example.springmessage.service.impl;

import org.example.springmessage.domain.User;
import org.example.springmessage.mapper.UserMapper;
import org.example.springmessage.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User login(String username) {
        return userMapper.login(username);
    }

    @Override
    public boolean register(User user) {
        return userMapper.register(user);
    }

    @Override
    public User getUserById(Integer id) {
        return userMapper.getUserById(id);
    }

    @Override
    public void update(User user) {
        userMapper.update(user);
    }

    @Override
    public List<User> getAllUsers() {
        return Collections.emptyList();
    }

    @Override
    public boolean updatePhoto(User user) {
        return userMapper.updatePhoto(user);
    }
}
